import { createWebHashHistory } from "vue-router";
import { createRouter } from "vue-router";

const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: "/",
            name: "Login",
            component: () => import("../components/Login/index.vue")
        },
        {
            path: "/register",
            name: "register",
            component: () => import("../components/Rigester/index.vue")
        },
        {
            path: "/admin",
            name: "admin",
            component: () => import("../components/Admin/index.vue"),
            children: [
                {
                    path: "",
                    name: "userMgt",
                    component: () => import("../components/Admin/userMgt.vue")
                },
                {
                    path: "birdMgt",
                    name: "birdMgt",
                    component: () => import("../components/Admin/birdMgt.vue")
                },
                {
                    path: "historyMgt",
                    name: "historyMgt",
                    component: () => import("../components/Admin/historyMgt.vue")
                },
                {
                    path: "collectionMgt",
                    name: "collectionMgt",
                    component: () => import("../components/Admin/collectionMgt.vue")
                },
                {
                    path: "dataCollect",
                    name: "dataCollect",
                    component: () => import("../components/Admin/dataCollect.vue")
                },
                {
                    path: "dataProcess",
                    name: "dataProcess",
                    component: () => import("../components/Admin/dataProcess.vue")
                },
                {
                    path: "log",
                    name: "log",
                    component: () => import("../components/Admin/log.vue")
                },
                {
                    path: "identificationAdmin",
                    name: "identificationAdmin",
                    component: () => import("../components/Admin/identificationAdmin.vue")
                },
                {
                    path: "uploadModel",
                    name: "uploadModel",
                    component: () => import("../components/Admin/uploadModel.vue")
                },
            ]
        },
        {
            path: "/home",
            name: "Home",
            component: () => import("../components/Home/index.vue"),
            children: [
                {
                    path: "",
                    name: "UserIndex",
                    component: () => import("../components/User/index.vue")
                },
                {
                    path: "personalInfo",
                    name: "personalInfo",
                    component: () => import("../components/User/personalInfo.vue"),
                    children: [
                        {
                            path: "",
                            name: "info",
                            component: () => import("../components/PersonalCenter/info.vue")
                        },
                        {
                            path: "password",
                            name: "password",
                            component: () => import("../components/PersonalCenter/password.vue")
                        },
                        {
                            path: "history",
                            name: "history",
                            component: () => import("../components/PersonalCenter/history.vue")
                        },
                        {
                            path: "setting",
                            name: "setting",
                            component: () => import("../components/PersonalCenter/setting.vue")
                        },
                        {
                            path: "collection",
                            name: "collection",
                            component: () => import("../components/PersonalCenter/collection.vue")
                        },
                        
                    ]
                },
                {
                    path: "identification",
                    name: "identification",
                    component: () => import("../components/User/identification.vue")
                },
                {
                    path: "birdAtlas",
                    name: "birdAtlas",
                    component: () => import("../components/User/birdAtlas.vue")
                },
                {
                    path: "birdDetail/:id",
                    name: "birdDetail",
                    component: () => import("../components/User/birdDetail.vue"),
                    children: [
                        {
                            path: "",
                            name: "baseIntroduction",
                            component: () => import("../components/BirdDetailInfo/baseIntroduction.vue")
                        },
                        {
                            path: "birdPicture",
                            name: "birdPicture",
                            component: () => import("../components/BirdDetailInfo/birdPicture.vue")
                        },
                        {
                            path: "birdSong",
                            name: "birdSong",
                            component: () => import("../components/BirdDetailInfo/birdSong.vue")
                        },
                        {
                            path: "formAndCts",
                            name: "formAndCts",
                            component: () => import("../components/BirdDetailInfo/formAndCts.vue")
                        },
                        {
                            path: "growthDistribution",
                            name: "growthDistribution",
                            component: () => import("../components/BirdDetailInfo/growthDistribution.vue")
                        },
                        {
                            path: "lifeHabits",
                            name: "lifeHabits",
                            component: () => import("../components/BirdDetailInfo/lifeHabits.vue")
                        },
                    ]
                },
                
            ]
        }
    ]
})

export default router;